<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2009 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/functionDefinition.xsl"?>
<function
  xmlns="http://xbrl.org/2008/function"
  xmlns:reg="http://xbrl.org/2008/registry"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:xff="http://www.xbrl.org/2010/function/formula" 
  xmlns:xffe="http://www.xbrl.org/2010/function/formula/error" 
  xmlns:xbrli="http://www.xbrl.org/2003/instance" 
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  ">

  <lastUpdated moment="2011-07-27T22:00:00" />

  <owners>
    <reg:owner id="herm">
       <reg:name>Herm Fischer</reg:name>
       <reg:affiliation>Mark V Systems (Formerly UBmatrix)</reg:affiliation>
       <reg:email>fischer@markv.com</reg:email>
       <reg:assumedOwnership moment="2011-07-08T22:00:00" />
    </reg:owner>
  </owners>

  <summary>
    Returns true() for factVariables that have been assigned a fallback value, for use in XPath expressions of 
    a precondition, a consistency assertion, value assertion, formula aspect rule, or generic message XPath expression.  
    The function is not applicable to variable-set variable and filter expressions.
  </summary>

  <documentation>
  </documentation>

  <reference xlink:type="simple" xlink:href="http://xbrl.org/Specification/variables/REC-2009-06-22/variables-REC-2009-06-22+corrected-errata-2011-03-16.html#term-fallback-value">
    Fallback Value
  </reference>
  
  <signature name="xff:has-fallback-value">
    <input name="variable" type="xs:QName">
      <xhtml:p>
        The variable to report on whether it has a fallback value.
      </xhtml:p>
    </input>
    <output type="xs:boolean">
      <xhtml:p>
        Returns true() if the argument variable is a factVariable and its value has been determined 
        on the basis of the content of the @fallbackValue attribute. 
      </xhtml:p>
      <xhtml:p>
        Returns false() if the argument variable is a factVariable and its value has been determined 
        on the basis of its source sequence rather than the content of a @fallbackValue attribute.
      </xhtml:p>
      <xhtml:p>
        Returns false() if the argument is not a factVariable (e.g., generalVariable, formula parameter, 
        or a variable assigned by an XPath 'for', 'some', or 'every' clause).
      </xhtml:p>
    </output>
  </signature>

  <error code="xffe:invalidFunctionUse">
    <xhtml:p>
      This error MUST be thrown if the this function is referenced in an XPath expression invoked
      in variable-set variable evaluation, such as by a generalVariable or filter XPath expression.
    </xhtml:p>
    <xhtml:p>
      A formula processor MAY detect this error as a static compilation-time error if it this
      function is referenced in variable-set variable evaluation expressions (by generalVariable or filters).
    </xhtml:p>
    <xhtml:p>
      A formula processor MUST detect this error as a dynamic run-time error if it this
      function is referenced in variable-set variable evaluation expressions (by generalVariable or filters),
      such as during execution of an XPath or other language implementation of custom functions
      that were invoked dynamically in variable-set evaluation expressions (by generalVariable or filters).
    </xhtml:p>
    <xhtml:p>
      This error MUST be thrown if the this function is referenced in an XPath expression invoked
      in an XPath function related to an existence assertion, including if referenced in an XPath
      expression from generic messages relating to an existence assertion.
    </xhtml:p>
  </error>

  <conformanceTest xlink:type="simple" xlink:href="80156 xff.has-fallback-value function testcase.xml"/>

  <revisions>
    <reg:revision on="2011-07-08T22:00:00" by="herm">
      <xhtml:p>
        Defined the function
      </xhtml:p>
    </reg:revision>

  </revisions>

</function>
